//===----------------------------------------------------------------------===//
//
// This source file is part of the Soto for AWS open source project
//
// Copyright (c) 2017-2022 the Soto project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of Soto project authors
//
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//

// THIS FILE IS AUTOMATICALLY GENERATED by https://github.com/soto-project/soto-codegenerator.
// DO NOT EDIT.

#if compiler(>=5.5.2) && canImport(_Concurrency)

import SotoCore

@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
extension LicenseManagerLinuxSubscriptions {
    // MARK: Async API Calls

    /// Lists the Linux subscriptions service settings.
    public func getServiceSettings(_ input: GetServiceSettingsRequest, logger: Logger = AWSClient.loggingDisabled, on eventLoop: EventLoop? = nil) async throws -> GetServiceSettingsResponse {
        return try await self.client.execute(operation: "GetServiceSettings", path: "/subscription/GetServiceSettings", httpMethod: .POST, serviceConfig: self.config, input: input, logger: logger, on: eventLoop)
    }

    /// Lists the running Amazon EC2 instances that were discovered with commercial Linux subscriptions.
    public func listLinuxSubscriptionInstances(_ input: ListLinuxSubscriptionInstancesRequest, logger: Logger = AWSClient.loggingDisabled, on eventLoop: EventLoop? = nil) async throws -> ListLinuxSubscriptionInstancesResponse {
        return try await self.client.execute(operation: "ListLinuxSubscriptionInstances", path: "/subscription/ListLinuxSubscriptionInstances", httpMethod: .POST, serviceConfig: self.config, input: input, logger: logger, on: eventLoop)
    }

    /// Lists the Linux subscriptions that have been discovered. If you have linked your organization, the returned results will include data aggregated across your accounts in Organizations.
    public func listLinuxSubscriptions(_ input: ListLinuxSubscriptionsRequest, logger: Logger = AWSClient.loggingDisabled, on eventLoop: EventLoop? = nil) async throws -> ListLinuxSubscriptionsResponse {
        return try await self.client.execute(operation: "ListLinuxSubscriptions", path: "/subscription/ListLinuxSubscriptions", httpMethod: .POST, serviceConfig: self.config, input: input, logger: logger, on: eventLoop)
    }

    /// Updates the service settings for Linux subscriptions.
    public func updateServiceSettings(_ input: UpdateServiceSettingsRequest, logger: Logger = AWSClient.loggingDisabled, on eventLoop: EventLoop? = nil) async throws -> UpdateServiceSettingsResponse {
        return try await self.client.execute(operation: "UpdateServiceSettings", path: "/subscription/UpdateServiceSettings", httpMethod: .POST, serviceConfig: self.config, input: input, logger: logger, on: eventLoop)
    }
}

// MARK: Paginators

@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
extension LicenseManagerLinuxSubscriptions {
    ///  Lists the running Amazon EC2 instances that were discovered with commercial Linux subscriptions.
    /// Return PaginatorSequence for operation.
    ///
    /// - Parameters:
    ///   - input: Input for request
    ///   - logger: Logger used flot logging
    ///   - eventLoop: EventLoop to run this process on
    public func listLinuxSubscriptionInstancesPaginator(
        _ input: ListLinuxSubscriptionInstancesRequest,
        logger: Logger = AWSClient.loggingDisabled,
        on eventLoop: EventLoop? = nil
    ) -> AWSClient.PaginatorSequence<ListLinuxSubscriptionInstancesRequest, ListLinuxSubscriptionInstancesResponse> {
        return .init(
            input: input,
            command: self.listLinuxSubscriptionInstances,
            inputKey: \ListLinuxSubscriptionInstancesRequest.nextToken,
            outputKey: \ListLinuxSubscriptionInstancesResponse.nextToken,
            logger: logger,
            on: eventLoop
        )
    }

    ///  Lists the Linux subscriptions that have been discovered. If you have linked your organization, the returned results will include data aggregated across your accounts in Organizations.
    /// Return PaginatorSequence for operation.
    ///
    /// - Parameters:
    ///   - input: Input for request
    ///   - logger: Logger used flot logging
    ///   - eventLoop: EventLoop to run this process on
    public func listLinuxSubscriptionsPaginator(
        _ input: ListLinuxSubscriptionsRequest,
        logger: Logger = AWSClient.loggingDisabled,
        on eventLoop: EventLoop? = nil
    ) -> AWSClient.PaginatorSequence<ListLinuxSubscriptionsRequest, ListLinuxSubscriptionsResponse> {
        return .init(
            input: input,
            command: self.listLinuxSubscriptions,
            inputKey: \ListLinuxSubscriptionsRequest.nextToken,
            outputKey: \ListLinuxSubscriptionsResponse.nextToken,
            logger: logger,
            on: eventLoop
        )
    }
}

#endif // compiler(>=5.5.2) && canImport(_Concurrency)
